/**
 * Copyright (C), 2019-2020, 宇信融汇
 * FileName: T2
 * Author:   xbliu
 * Date:     2020/6/5 17:27
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * xbliu           修改时间           版本号              描述
 */
package c_001;

/**
 * @Classname T2
 * @Description 递归算法
 * @Date 2020/6/5 17:27
 * @Created by xbliu
 */
public class T2 {
    public static void main(String[] args) {
        for (int i = 1; i <=5; i++) {
            System.out.print(getNumber(i)+"\t");

        }

    }
    public  static int getNumber(int number){
        if (number==1||number==2){
            return 1;
        }else{
            return getNumber(number - 1) + getNumber(number -2);//3-1+3-2=3 3-1 +32-2
        }

    }
}
